GList *input_messages;
guint process_input_idle;
- GHashTable *id_ht;
+ GHashTable *surface_id_hash;
GList *surfaces;
BroadwaySurface *root;
gint32 focused_surface_id; /* -1 => none */
server->pointer_grab_surface_id = -1;
server->saved_serial = 1;
server->last_seen_time = 1;
- server->id_ht = g_hash_table_new (NULL, NULL);
+ server->surface_id_hash = g_hash_table_new (NULL, NULL);
server->id_counter = 0;
server->textures = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL,
(GDestroyNotify)g_bytes_unref);
server->root = root;
- g_hash_table_insert (server->id_ht,
+ g_hash_table_insert (server->surface_id_hash,
GINT_TO_POINTER (root->id),
root);
}
g_free (surface);
}
+static BroadwaySurface *
+broadway_server_lookup_surface (BroadwayServer *server,
+ guint32 id)
+{
+ return g_hash_table_lookup (server->surface_id_hash,
+ GINT_TO_POINTER (id));
+}
+
static void start (BroadwayInput *input);
static void
case BROADWAY_EVENT_UNGRAB_NOTIFY:
break;
case BROADWAY_EVENT_CONFIGURE_NOTIFY:
- surface = g_hash_table_lookup (server->id_ht,
- GINT_TO_POINTER (message->configure_notify.id));
+ surface = broadway_server_lookup_surface (server, message->configure_notify.id);
if (surface != NULL)
{
surface->x = message->configure_notify.x;
broadway_output_destroy_surface (server->output,
id);
- surface = g_hash_table_lookup (server->id_ht,
- GINT_TO_POINTER (id));
+ surface = broadway_server_lookup_surface (server, id);
if (surface != NULL)
{
server->surfaces = g_list_remove (server->surfaces, surface);
- g_hash_table_remove (server->id_ht,
+ g_hash_table_remove (server->surface_id_hash,
GINT_TO_POINTER (id));
broadway_surface_free (surface);
}
BroadwaySurface *surface;
gboolean sent = FALSE;
- surface = g_hash_table_lookup (server->id_ht,
- GINT_TO_POINTER (id));
+ surface = broadway_server_lookup_surface (server, id);
if (surface == NULL)
return FALSE;
BroadwaySurface *surface;
gboolean sent = FALSE;
- surface = g_hash_table_lookup (server->id_ht,
- GINT_TO_POINTER (id));
+ surface = broadway_server_lookup_surface (server, id);
if (surface == NULL)
return FALSE;
{
BroadwaySurface *surface;
- surface = g_hash_table_lookup (server->id_ht,
- GINT_TO_POINTER (id));
+ surface = broadway_server_lookup_surface (server, id);
if (surface == NULL)
return;
{
BroadwaySurface *surface;
- surface = g_hash_table_lookup (server->id_ht,
- GINT_TO_POINTER (id));
+ surface = broadway_server_lookup_surface (server, id);
if (surface == NULL)
return;
{
BroadwaySurface *surface;
- surface = g_hash_table_lookup (server->id_ht,
- GINT_TO_POINTER (id));
+ surface = broadway_server_lookup_surface (server, id);
if (surface == NULL)
return;
{
BroadwaySurface *surface;
- surface = g_hash_table_lookup (server->id_ht, GINT_TO_POINTER (id));
+ surface = broadway_server_lookup_surface (server, id);
if (surface == NULL)
return;
gboolean with_resize;
gboolean sent = FALSE;
- surface = g_hash_table_lookup (server->id_ht,
- GINT_TO_POINTER (id));
+ surface = broadway_server_lookup_surface (server, id);
if (surface == NULL)
return FALSE;
surface->height = height;
surface->is_temp = is_temp;
- g_hash_table_insert (server->id_ht,
+ g_hash_table_insert (server->surface_id_hash,
GINT_TO_POINTER (surface->id),
surface);